
this.base = {};

base.basePath = "";

//base.file_folder_name = 'http://file.ecoalchina.com:81/portweb/';//服务器地址
/* 操作附件的相关信息  start */
base.filePageContorllerUrl = "/main/upload";
base.fileuploadOptions = {};
base.setFileuploadOptions = function(options){
    var fileuploadOptions = base.fileuploadOptions ;
  //  fileuploadOptions.file_folder_name = options.file_folder_name ||base.file_folder_name;
    fileuploadOptions.accept = options.accept || {};
    fileuploadOptions.fileNumLimit = options.fileNumLimit || 300;//300个,验证文件总数量, 超出则不允许加入队列。
    fileuploadOptions.fileSizeLimit = options.fileSizeLimit ||200 * 1024 * 1024; // 5 M 验证文件总大小是否超出限制, 超出则不允许加入队列。
    fileuploadOptions.fileSingleSizeLimit = options.fileSingleSizeLimit ||5 * 1024 * 1024;   // 50 M 验证单个文件大小是否超出限制, 超出则不允许加入队列。
    fileuploadOptions.all_call_back = options.all_call_back ||function(){};
    fileuploadOptions.close_fun = function(){
        var index = layer.index; 
        layer.close(index);
        $.messager.alert('提示','<h4>上传成功！</h4>');
    };//点击上传完成
    return fileuploadOptions;
};
base.getFileuploadOptions = function(){
    return base.fileuploadOptions;
};

base.path = function(str) {
    return base.basePath + str;
};

/**
 *  公用方法，打开上传页面
 */
base.openUpload = function(options,callback){
    
    layer.open({
        type: 2,
        title: options.title||'上传附件',
        resize:false,
        scrollbar: false,
        fix: true,
        shadeClose: true,
        area: ['480px', '350px'],
        content:base.path(base.filePageContorllerUrl)
    });
    
    base.setFileuploadOptions(options);
};

